summaryrefslogtreecommitdiffstats
path: root/src/hid_core/resources/debug_pad/debug_pad_types.h
blob: 8b5eb108ef4921a289581ebd069eab6e14f452e6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later

#pragma once

#include "common/bit_field.h"
#include "common/common_types.h"
#include "hid_core/hid_types.h"

namespace Service::HID {

// This is nn::hid::DebugPadAttribute
struct DebugPadAttribute {
    union {
        u32 raw{};
        BitField<0, 1, u32> connected;
    };
};
static_assert(sizeof(DebugPadAttribute) == 0x4, "DebugPadAttribute is an invalid size");

// This is nn::hid::DebugPadState
struct DebugPadState {
    s64 sampling_number{};
    DebugPadAttribute attribute{};
    Core::HID::DebugPadButton pad_state{};
    Core::HID::AnalogStickState r_stick{};
    Core::HID::AnalogStickState l_stick{};
};
static_assert(sizeof(DebugPadState) == 0x20, "DebugPadState is an invalid state");

} // namespace Service::HID